{
    let app = new Vue({
        el: '.stage',
        data: {
            prevX: -1,
            x: 0
        }
    });

    class Env {
        constructor () {
            this.vueRoot = app;
        }

        update(x) {
            if ( x === 0 ) {
                this.vueRoot.prevX = -1;
            } else {
                this.vueRoot.prevX = this.vueRoot.x;
            }
            this.vueRoot.x = x;
        }
    }

    window.Env = Env;
}